
Version:=2.3.2
#Version:=2.9.05d # Test!
ModuleName:=p3scan

Objcet:=$(ModuleName).tgz
ObjectDir:=$(ModuleName)-$(Version)
ObjcetSource:=$(ModuleName)-$(Version).tar.gz

Version2:=1.4.0.6
ModuleName2:=ripmime
Object2:=$(ModuleName2).tgz
ObjectDir2:=$(ModuleName2)-$(Version2)
ObjectSource2:=$(ModuleName2)-$(Version2).tar.gz

DependFiles:=
InstaEtcDir:=usr/local/etc
InstaLibDir:=usr/lib
InstaSbinDir:=usr/local/sbin
InstaTempDir:=var/spool/p3scan
InstaChilDir:=$(InstaTempDir)/children
InstaNotiDir:=$(InstaTempDir)/notify

InstallDirTmp:=usr/local/$(ModuleName)
InstallDir:=/$(InstallDirTmp)
ManDir:=/tmp

Config:=--mandir=$(ManDir) --prefix=$(InstallDir) --with-clamav=/usr/local/clamav --with-ripmime=/usr/bin \
	--with-openssl=/usr/local/ssl --disable-pop3s
Config2:=--mandir=$(ManDir) --prefix=$(InstallDir) --with-clamav=/usr/local/clamav

Patch:=patch -p0 < p3scan.patch

.PHONY: all clean dist_clean

all:$(Objcet) 

$(Objcet):$(ObjcetSource) p3scan.conf
	tar -xzf $(ObjcetSource)
	$(Patch)
	$(MAKE) -C $(ObjectDir)
	mkdir -p $(InstaEtcDir) $(InstaSbinDir) $(InstaLibDir) $(InstaChilDir) $(InstaNotiDir)
	chmod 777 -R $(InstaChilDir) $(InstaNotiDir)
	cp $(ObjectDir)/p3scan $(InstaSbinDir)
	cp p3scan.conf $(ObjectDir)/p3scan-en.mail $(InstaEtcDir)
	cp -af /usr/lib/libpcre.so* $(InstaLibDir)
	tar -czf $(Objcet) usr var

clean:
	rm -rf $(Objcet) usr $(Objcet_Cvd) var

dist_clean:clean
	rm -rf $(ObjectDir) $(ObjcetSource) 
	
include ../Makefile.Res
